@use '@lingshu/theme-lib/scss/util.scss' as *;

// ==================== 响应式断点 Mixin ====================

// 小于指定断点
@mixin screen-below($breakpoint) {
  @media (max-width: #{$breakpoint - 0.02px}) {
    @content;
  }
}

// 大于等于指定断点
@mixin screen-above($breakpoint) {
  @media (min-width: $breakpoint) {
    @content;
  }
}

// 在指定断点区间内
@mixin screen-between($min-breakpoint, $max-breakpoint) {
  @media (min-width: $min-breakpoint) and (max-width: #{$max-breakpoint - 0.02px}) {
    @content;
  }
}

// 预定义的常用断点 Mixin
@mixin screen-mobile-only {
  @include screen-below($screen-4xl);
}

@mixin screen-tablet-only {
  @include screen-between($screen-4xl, $screen-5xl);
}

@mixin screen-desktop-only {
  @include screen-above($screen-5xl);
}

// 针对具体尺寸的 Mixin（基于项目断点）
@mixin screen-below-1600 {
  @include screen-below($screen-4xl);
}

@mixin screen-1600-to-1920 {
  @include screen-between($screen-4xl, $screen-5xl);
}

@mixin screen-above-1920 {
  @include screen-above($screen-5xl);
}

// ==================== 全局字体设置 ====================
// 覆盖 UnoCSS 重置样式中的系统字体设置
html,
:host {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'PingFang SC', 'Noto Sans SC', sans-serif;
}

*:focus {
  outline: none;
}

.hy-popover-no-padding {
  padding: 0 !important;
}
// popover 为菜单选项样式时，padding值
.hy-popover-menu-padding {
  padding: 4px 0 !important;
}

// 给元素添加遮罩层
.hy-over-layout {
  &::after {
    content: ' ';
    min-height: 0;
    min-width: 0;
    display: flex;
    flex: 1 1 auto;
    position: absolute;
    z-index: 2;
    background: transparent;
  }
}

.hy-pop-confirm {
  .el-popconfirm__icon {
    align-self: baseline;
    margin-top: 4px;
  }
}
// 抽屉高度需要去掉顶部栏 58px, 子项目直接使用该类名即可
.hy-layout-drawer {
  &.el-drawer.rtl {
    top: 58px;
    height: calc(100% - 58px);
  }
}

// 文本高亮
.hy-highlight-keyword {
  color: var(--ls-color_primary);
  background: transparent;
}

/* 表格外边框 */
.el-table {
  border: none;
}

/* 表头边框 */
.el-table .el-table__header {
  border: none;
}

/* 表头单元格边框 */
.el-table .el-table__header th {
  border: none;
  position: relative; /* 为伪元素定位做准备 */
}

/* 使用伪元素创建固定高度的表头分割线 */
.el-table .el-table__header th:not(:last-child) .cell::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 1px;
  border-radius: 1px;
  height: 24px; /* 固定高度，不随单元格高度变化 */
  background-color: var(--ls-border_bg2, #d9d9d9);
}

/* 表格主体边框 */
.el-table .el-table__body {
  border: none;
}

/* 表格单元格边框 */
.el-table .el-table__body td {
  border: none;
}

/* 表格行边框 - 添加下边框 */
.el-table .el-table__row {
  border: none;
}

/* 表格底部边框 */
.el-table::before {
  height: 0;
}

/* 表格行底部边框 */
.el-table::after {
  width: 0;
}

/* 去除表头底部分割线 */
.el-table .el-table__header-wrapper th {
  border-bottom: none;
}

/* 去除单元格底部分割线 */
.el-table .el-table__body-wrapper td {
  border-bottom: 1px solid var(--cs-divider, #e6e6e6);
}

/* 去除行悬停时的边框效果 */
.el-table .el-table__body tr:hover > td {
  border: none;
  border-bottom: 1px solid var(--cs-divider, #e6e6e6);
}

/* 去除固定列边框 */
.el-table .el-table__fixed::before,
.el-table .el-table__fixed-right::before {
  height: 0;
}

.el-table.is-scrolling-left.el-table--border .el-table-fixed-column--left.is-last-column.el-table__cell {
  border-right: 0px !important;
}


.el-empty {
  .el-empty__image {
    width: 140px !important;

    svg {
      width: 140px !important;
      height: 140px !important;
    }
  }

  .el-empty__description {
    margin-top: 20px;

    p {
      font-size: 14px;
    }
  }
}

.el-message {
  font-size: 16px;

  .el-message__content {
    font-size: 16px;
  }

  i {
    font-size: 20px !important;
  }
}
